home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 19 / CU Amiga Magazine's Super CD-ROM 19 (1998)(EMAP Images)(GB)[!][issue 1998-02].iso / CUCD / Graphics / Gallery / Source / main.cpp < prev    next >
Encoding:
C/C++ Source or Header  |  1997-11-20  |  2.5 KB  |  96 lines

  1. #define __VER__             "39"
  2. #define __REV__                 "11"
  3. #define __NAME__            "Gallery"
  4. #define __AUTHOR__        "Markus Hillenbrand"
  5.  
  6. /*********************************************************************************************************/
  7.  
  8. #include <string.h>
  9. #include <stdlib.h>
  10. #include <stdio.h>
  11. #include <stream.h>
  12.  
  13. #include <clib/utility_protos.h>
  14.  
  15. #include "GUIC_AmigaGuide.hpp"
  16. #include "GUIC_Application.hpp"
  17. #include "GUIC_Error.hpp"
  18. #include "GUIC_Event.hpp"
  19. #include "GUIC_Exceptions.hpp"
  20. #include "GUIC_FileExamine.hpp"
  21. #include "GUIC_FontRequester.hpp"
  22. #include "GUIC_Message.hpp"
  23. #include "GUIC_Screen.hpp"
  24. #include "GUIC_ScreenRequester.hpp"
  25. #include "GUIC_System.hpp"
  26.  
  27. #include "HTMLWindow.hpp"
  28. #include "MainWindow.hpp"
  29. #include "PrefsWindow.hpp"
  30. #include "CompareWindow.hpp"
  31.  
  32. /*********************************************************************************************************/
  33.  
  34. STRPTR V = "$VER: " __NAME__ " " __VER__ "." __REV__ " (" __DATE__ ")";
  35.  
  36. /*********************************************************************************************************/
  37.  
  38. VOID main (LONG argc, STRPTR argv[])
  39. {
  40.     GUIC_SystemC::checkStackSize(50000);
  41.     
  42.     GUIC_ApplicationC             app(__NAME__);
  43.     GUIC_AmigaGuideC            amigaGuide("Gallery.guide");
  44.     GUIC_ScreenRequesterC    screenRequester;
  45.     GUIC_FontRequesterC        fontRequester;
  46.     GUIC_ScreenC                    screen("Workbench");
  47.     
  48.     app.setAuthor        (__AUTHOR__);
  49.     app.setVersion    (__VER__);
  50.     app.setRevision    (__REV__);
  51.     app.setDate        (__DATE__);
  52.     app.setTime        (__TIME__);
  53.     
  54.     app.setInitializer    (TRUE);
  55.  
  56.     screen.setPicture            ("gfx/back.iff");
  57.     screen.setName                ("Gallery - (c) by Markus Hillenbrand");
  58.     screen.setPublicMode        (TRUE);
  59.     screen.setPublicName    ("Gallery");
  60.  
  61.     PrefsWindowC        pWindow        (app, screen, screenRequester, fontRequester);
  62.     HTMLWindowC        hWindow        (app, screen, pWindow);
  63.     ManagerWindowC    gWindow        (app, screen, pWindow);
  64.     CompareWindowC    cWindow        (app, screen, pWindow);
  65.     MainWindowC         mWindow    (app, screen, pWindow, hWindow, gWindow, cWindow);
  66.     
  67.     app.add(amigaGuide);
  68.     app.add(screen);
  69.     
  70.     app.start();
  71.  
  72.     pWindow.setPrefs();    /* This mist be done after app.start() to enable all saved settings */
  73.     
  74.     screen.add(mWindow);
  75. //    screen.add(gWindow);
  76.  
  77.     BOOL running = TRUE;
  78.     GUIC_EventC *event = 0;
  79.  
  80.     while (running && (event = app.wait()) )
  81.         {
  82.         if (event->id == GUIC_CloseWindow)
  83.             {
  84.             if (event->window == (GUIC_WindowC *) &mWindow)
  85.                 {
  86.                 GUIC_MessageC    message    ("Gallery", "Do you really want to quit ?", "Yes|No");
  87.                 if (1 == message.request(*event->window)) running = FALSE;
  88.                 }
  89.             else pWindow.windowClosed(event->window);
  90.             }
  91.         }
  92.  
  93.     app.stop();
  94. }
  95.  
  96.